package com.qdlc.p2p.dal.model;

import com.qdlc.p2p.dal.dto.CashAwardRule;
import org.springframework.beans.BeanUtils;

/**
 * 现金奖励规则 Model
 *
 * @author Kaiju Zhao
 * @date 2016-3-23
 */
public class CashAwardRuleModel extends CashAwardRule {

	/**
	 * 状态：未使用
	 */
	public static final int CASH_AWARD_RULE_STATUS_ENABLE = 0;

	/**
	 * 状态：已使用
	 */
	public static final int CASH_AWARD_RULE_STATUS_DISABLE = 1;

	/**
	 * 搜索框输入字符串
	 */
	private String searchName;

	/**
	 * 修改者姓名
	 */
	private String modifierName;

	/**
	 * 创建者姓名
	 */
	private String creatorName;

	/**
	 * 当前页
	 */
	private int page;

	/**
	 * 每页记录数
	 */
	private int rows;

	public String getSearchName() {
		return searchName;
	}

	public void setSearchName(String searchName) {
		this.searchName = searchName;
	}

	public String getModifierName() {
		return modifierName;
	}

	public void setModifierName(String modifierName) {
		this.modifierName = modifierName;
	}

	public String getCreatorName() {
		return creatorName;
	}

	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}


	/**
	 * 实例化CashAwardRuleModel
	 *
	 * @author Kaiju Zhao
	 * @param cashAwardRule
	 * @return CashAwardRuleModel
	 */
	public static CashAwardRuleModel instance(CashAwardRule cashAwardRule) {
		CashAwardRuleModel model = new CashAwardRuleModel();
		BeanUtils.copyProperties(cashAwardRule, model);
		return model;
	}
	
	/**
	 * 根据Model返回实体原型
	 *
	 * @author Kaiju Zhao
	 * @param model
	 * @return CashAwardRule
	 */
	public static CashAwardRule prototype(CashAwardRuleModel model) {
		CashAwardRule cashAwardRule = new CashAwardRule();
		BeanUtils.copyProperties(model, cashAwardRule);
		return cashAwardRule;
	}

}
